package com.bum.api.processor.dj.json;

import org.apache.commons.lang.StringUtils;

import com.bum.api.core.exp.om.Metas;
import com.bum.api.core.exp.om.Params;
import com.bum.api.core.service.process.ApiProcess;
import com.bum.api.processor.dj.json.bo.DjJsonBO;

public class DjJsonProcess extends ApiProcess {
	DjJsonBO	djJsonBO;

	enum Func {
		streams
	}

	@Override
	public String process(String path, Params params, Metas metas) {
		String[] parts = StringUtils.split(path, "/", 3);

		Func func = null;
		if (parts.length > 2) {
			func = Func.valueOf(parts[1]);
			switch (func) {
				case streams:
					/**
					 * dj/streams/id
					 */
					return djJsonBO.streams(parts.length > 2 ? parts[2] : null, params, metas);

				default:
					break;
			}
		}

		return null;
	}

	public void setDjJsonBO(DjJsonBO djJsonBO) {
		this.djJsonBO = djJsonBO;
	}

}
